package com.pubinfo.passbook.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pubinfo.passbook.common.entity.TPassbook;
import com.pubinfo.passbook.common.model.bo.SubsidiaryInfo;
import com.pubinfo.passbook.common.model.bo.passbook.TPassbookDist;
import com.pubinfo.passbook.common.model.bo.witeoff.InvoiceInfo;
import com.pubinfo.passbook.common.model.bo.witeoff.UserPassbookListParam;
import com.pubinfo.passbook.common.model.dto.financial.PassbookPageParamObj;
import com.pubinfo.passbook.common.model.ruler.PassbookInformation;
import com.pubinfo.passbook.common.model.ruler.PayInformation;
import com.pubinfo.passbook.common.model.vo.PassbookVo;
import com.pubinfo.passbook.common.model.vo.base.MyPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Entity com.pubinfo.passbook..TSourcePassbook
 */
public interface TSourcePassbookMapper extends BaseMapper<TPassbook> {
 
 List<String> selectLockedAll();
 
 Boolean updateReimbursableSumById(@Param("information") PayInformation information);

 Boolean updateReimbursableSumByWiteoffId(@Param("information") PayInformation information,@Param("witeoffId")String witeoffId);

 Boolean updatePassbookWiteoffSum(String id);

 Boolean updateAgainPassbookWiteoffSum(@Param("id")String id,@Param("oldId")String oldId);

  Integer updateInvoiceStatus();
  
  Boolean insertPassbookWiteoff(@Param("witeoffId") String witeoffId, @Param("invoiceIds") List<String> invoiceIds);

 List<String> selectPassbookWiteoffByWiteoffId(String witeoffId);
 
 List<TPassbook> findPassbookByWiteoffId(@Param("witeoffId") String witeoffId);
 
 MyPage<PassbookVo> listTPassbook(MyPage<PassbookVo> page, @Param("obj") PassbookPageParamObj obj);
  
  MyPage<PassbookVo> listTPassbookByParam(MyPage<PassbookVo> page, @Param("obj") PassbookPageParamObj obj);
  
  MyPage<PassbookVo> listTPassbookByDep(MyPage<PassbookVo> page, @Param("obj") PassbookPageParamObj obj);
 
 MyPage<PassbookVo> listTPassbookByUser(MyPage<PassbookVo> page, @Param("obj") PassbookPageParamObj obj);
 
 TPassbook selectPassbookByInvoice(String id);
 
 List<TPassbook> selectPassbookByInvoiceList(@Param("ids") List<String> ids);
 
 List<TPassbook> selectRepetition();
 
 List<TPassbook> findPassbookByWiteoffids(@Param("witeoffids") List<String> witeoffids);
 
 List<TPassbookDist> findAutoReimbursement(@Param("eInvoiceIds") List<String> eInvoiceIds);
 
 Boolean updateSystemIsLocked(String id);
 
 IPage<PassbookVo> findAutoReimbursementByStaffCode(IPage<TPassbook> iPage, @Param("obj") UserPassbookListParam obj);
  
  InvoiceInfo invoiceInfoById(String id);
  
  SubsidiaryInfo findKeyByInvoiceId(@Param("invoiceId") String invoiceId);
  
  List<TPassbook> selectNotDownload();
  
  TPassbook selectByEInvoiceId(@Param("eInvoiceId") String eInvoiceId);

  Boolean updateIsDownload();
  
  IPage<TPassbook> selectPassbookByAcct(IPage<TPassbook> page, @Param("acct") String acct);

 IPage<PassbookInformation> selectTPassbookInformationByAcct(IPage<PassbookInformation> page, @Param("acct") String acct);

  List<TPassbook> selectPassbookByFpdmAndFphm(@Param("passbook") List<TPassbook> passbook);

  List<TPassbook> selectPassbookByOtherSystemMainId(String otherSystemMainId);

  String passbookAmountSum(@Param("acct") String acct,@Param("type") String type);

  String getRegular();

  Boolean deletePassbookWiteoff(String witeoffId);
}




